package com.yyjj.hangqing.adapter;

import android.os.Bundle;
import android.view.View;

import com.alibaba.android.arouter.launcher.ARouter;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.yyjj.hangqing.R;
import com.yyjj.hangqing.entity.FundEntity;
import com.yyjj.hangqing.entity.HuoQiBaoEntity;

import tech.com.commoncore.utils.OnNoDoubleClickListener;


public class HuoQiBaoAdapter extends BaseQuickAdapter<HuoQiBaoEntity, BaseViewHolder> {

    public HuoQiBaoAdapter(int layoutResId) {
        super(layoutResId);
    }

    @Override
    protected void convert(BaseViewHolder helper, final HuoQiBaoEntity item) {
//        if (item.getCn_name().equals("－")){

//        if (Float.parseFloat(item.getDan_clean())>0){
            helper.setText(R.id.tv_name, item.getName());
            helper.setText(R.id.tv_date, item.getDate());

            helper.setText(R.id.tv_code, item.getSymbol());
                helper.setText(R.id.tv_percent, item.getUnitValue());
//        }

        helper.itemView.setOnClickListener(new OnNoDoubleClickListener() {
            @Override
            public void onNoDoubleClick(View v) {
                        Bundle bundle = new Bundle();
                        bundle.putString("symbol",item.getSymbol());
                        ARouter.getInstance().build("/hq/FundH5").with(bundle).navigation();
            }
        });


//        }else {
//            helper.setText(R.id.tv_title,item.getCn_name());
//        }
//        helper.setText(R.id.tv_price,item.getPrice())
//                .setText(R.id.tv_percent,item.getFrom_to())
//                .setOnClickListener(R.id.ll_item, new OnNoDoubleClickListener() {
//                    @Override
//                    public void onNoDoubleClick(View v) {
//                        Bundle bundle = new Bundle();
//                        bundle.putString("symbol",item.getSymbol());
//                        ARouter.getInstance().build("/hq/kline/coin").with(bundle).navigation();
//                    }
//                });
    }
}
